package factory

import "fmt"

type Restaurant interface {
	GetFood()
}

type Donglaishun struct {
}

func (d *Donglaishun) GetFood() {
	fmt.Println("I am Donglaishun")
}

type Qingfeng struct {
}

func (q *Qingfeng) GetFood() {
	fmt.Println("I am Qingfeng")
}

func NewRestaurant(name string) Restaurant {
	switch name {
	case "Donglaishun":
		return &Donglaishun{}
	case "Qingfeng":
		return &Qingfeng{}
	default:
		return nil
	}
}
